package homework.ooday05._cp;

import java.util.Random;

public class SeasonDemo {
    public static void main(String[] args) {
        Season[] seasons = Season.values();
        Season s = null;

        Random rand = new Random();
        int n = rand.nextInt(seasons.length);
        for(int i=0;i<seasons.length;i++){
            System.out.println(seasons[i].getName()+","+seasons[i].getValue());
            if(n==i){
                s = seasons[i];
            }
        }
        System.out.println("n="+n);
        switch (s){
            case SPRING:
                System.out.println("1号"+s.getValue());
                break;
            case SUMMER:
                System.out.println("2号"+s.getValue());
                break;
            case AUTUMN:
                System.out.println("3号"+s.getValue());
                break;
            case WINTER:
                System.out.println("4号"+s.getValue());
                break;
        }
    }
}
